﻿// Copyright (c) Vitaly Kamiansky. All rights reserved. 
// See License.txt in the project root.

using System;
using System.Collections.Generic;

namespace Property
{
    /// <summary>
    /// Contains List extensions missing from portable .Net 
    /// </summary>
    public static class ListExtensions
    {
        /// <summary>
        /// Analog of List.ForEach(..) 
        /// </summary>
        public static void ApplyAction<T>(this List<T> source, Action<T> action)
        {
            if (source == null) throw new ArgumentNullException("source");

            foreach(var o in source) action(o);
        }
    }
}
